<?php

namespace summer\swoole\pool\contract;

interface ConnectionInterface
{
    /**
     * Get the real connection from pool.
     */
    function getConnection();

    /**
     * Reconnect the connection.
     */
    function reconnect(): bool;

    /**
     * Check the connection is valid.
     */
    function check(): bool;

    /**
     * Close the connection.
     */
    function close(): bool;

    /**
     * Release the connection to pool.
     */
    function release(): void;
}